import {Component} from '@angular/core';
import {NavController, PopoverController, ModalController, ActionSheetController} from 'ionic-angular';
import {StoragePage} from "../storage/storage";
//import {PopOverPage} from "../popoverPage/popoverPage";

@Component({
    selector: 'newCreat',
    templateUrl: 'newcreat.html'
})
export class NewCreatPage {
    showAlert = true;
    product = "红星经典二锅头";

    constructor(public navCtrl: NavController,
                public popoverCtrl: PopoverController,
                public modalCtrl: ModalController,
                public actionSheetCtrl: ActionSheetController) {

    }

    // presentProfileModal() {
    //     let profileModal = this.modalCtrl.create(PopOverPage, { userId: 8675309 });
    //     profileModal.present();
    // }

    presentActionSheet() {
        let actionSheet = this.actionSheetCtrl.create({
            title: '',
            cssClass: 'action-sheets-basic-page',
            buttons: [
                {
                    text: '红星经典二锅头',
                    handler: () => {
                        console.log('红星经典二锅头');
                    }
                }, {
                    text: '红星经典二锅头',
                    handler: () => {
                        console.log('红星经典二锅头');
                    }
                }, {
                    text: '红星经典二锅头',
                    handler: () => {
                        console.log('红星经典二锅头');
                    }
                }, {
                    text: '取消',
                    handler: () => {
                        console.log('取消');
                    }
                }
            ]
        });
        actionSheet.present();
    }

    toShowAlert() {
        this.showAlert = false;
    }

    btnCancel() {
        this.showAlert = true;
    }

    btnChoose() {
        this.showAlert = true;
        this.navCtrl.popToRoot(StoragePage);
    }


}
